package com.sch.www.ele.feign.factory;


import com.sch.www.ele.feign.CareUserApi;
import com.sch.www.ele.feign.fallback.CareUserApiFallbackImpl;
import feign.hystrix.FallbackFactory;

/**
 * 用户断路器工厂
 *
 * @author tangyi
 * @date 2019/3/23 23:38
 */

public class UserServiceClientFallbackFactory implements FallbackFactory<CareUserApi> {

    public UserServiceClientFallbackFactory() {

    }

    @Override
    public CareUserApi create(Throwable throwable) {
        CareUserApiFallbackImpl userServiceClientFallback = new CareUserApiFallbackImpl();
        userServiceClientFallback.setThrowable(throwable);
        return userServiceClientFallback;
    }
}
